package com.zw.yzk.kabu.view.widget;

import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.zw.yzk.kabu.R;
import com.zw.yzk.kabu.management.AppManager;

/**
 * Created by zhanwei on 2016/12/31.
 */

public class LogoutDialog {

    public void showLogoutDialog(final AppCompatActivity context) {
        new CustomAlertDialog.Builder(context, R.layout.dialog_logout)
                .setTitle(R.id.title, context.getResources().getString(R.string.log_out))
                .setNegativeButton(R.id.cancel, context.getResources().getString(R.string.cancel))
                .setPositiveButton(R.id.confirm, context.getResources().getString(R.string.confirm))
                .setOnPositiveButtonClickerListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        AppManager.logout(context);
                    }
                })
                .setCancelable(false).build().show();
    }

}
